#pragma once

#include <QWidget>

class QTimer;
class FadeTips : public QWidget {
 public:
  FadeTips(QWidget*);
  void setMargin(int x, int y);
  void setMessage(const QString& txt) { m_msg = txt; }

 protected:
  virtual QSize sizeHint() const override;
  virtual void mousePressEvent(QMouseEvent* event) override;
  virtual void paintEvent(QPaintEvent* event) override;
  virtual void showEvent(QShowEvent* event) override;

  void onTimer();
  void hideMe();

 private:
  int m_hMargin = 0;
  int m_vMargin = 0;
  QString m_msg;
  QTimer* m_timer = nullptr;
  bool m_hiding = false;
  int m_count = 0;
};